package com.example.administrator.maizuofilm.main.fragment.activity;

import com.example.administrator.maizuofilm.bean.Active;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

/**
 * Created by Administrator on 2016/7/13.
 */
public class ActivePresenter implements ActiveContract.Presenter{
    private ActiveContract.View mView;
    private ActiveContract.Model mModel;
    public  ActivePresenter(ActiveContract.View mView, ActiveContract.Model mModel){
        this.mModel = mModel;
        this. mView = mView;
//        init();
//        EventBus.getDefault().register(this);
    }

    @Override
    public void init() {
        mModel.init();
    }
@Subscribe(threadMode =ThreadMode.MAIN)
   public void getEventMsg(Active active){
        if (active==null){
            mView.onInitFail();
        }else {
            mView.onInitSuccess(active);
        }
    }
}
